package top.yuhaitao.cloud.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import top.yuhaitao.cloud.entity.User;
import top.yuhaitao.cloud.feign.UserFeignClient;

@RestController
public class MovieController {
	@Autowired
	private UserFeignClient userFeignClient;

	@GetMapping("/getUserById/{id}")
	public User findById(@PathVariable Long id) {
		return this.userFeignClient.getUserById(id);
	}

	@GetMapping("/getUserById2/{id}")
	public User findById2(@PathVariable Long id) {
		return this.userFeignClient.getUserById2(id);
	}

	@GetMapping("/test")
	public User testPost(User user) {
		return this.userFeignClient.postUser(user);
	}

	@GetMapping("/getUser")
	public User getUser(User user) {
		return this.userFeignClient.getUser(user);
	}
}
